package com.hc.model.code04.test8;

/**
 * @version v1.0
 * @ClassName: Client
 * @Description: 迭代器模式测试
 * @Author: HC
 */
public class Client {

    public static void main(String[] args) {
        StudentAggregate studentAggregate = new StudentAggregateImpl();
        studentAggregate.addStudent(new Student("张无忌", "001"));
        studentAggregate.addStudent(new Student("公孙瓒", "002"));

        StudentIterator studentIterator = studentAggregate.getStudentIterator();
        while (studentIterator.hashNext()) {
            Student student = studentIterator.next();
            System.out.println(student);
        }
    }
}
